package com.huitone.gddw.service.dto.analysis.traffic;

import java.util.Date;

import com.huitone.gddw.common.excel.ColToProperty;
import com.huitone.gddw.common.excel.TabCol;
import com.huitone.gddw.utils.SysLoginUtil;

/**
 * 下发短信明细
 * @author wuluodan
 *
 */
public class DownSmRecDTO {

	@ColToProperty
	@TabCol(Index = 1, title = "序号", width = "30")
	private Integer seq;
	
	@ColToProperty
	@TabCol(Index = 3, title = "短信递交时间", width = "130")
	private Date sendTime;
	
	@ColToProperty
	@TabCol(Index = 2, title = "手机号码", width = "90")
	private String userNo;

	@ColToProperty
	@TabCol(Index = 5, title = "业务端", width = "90")
    private String srvName;

	@ColToProperty
	@TabCol(Index = 6, title = "业务类型", width = "90")
    private String serviceName;
    
	@ColToProperty
	@TabCol(Index = 7, title = "发送通道", width = "90")
    private String gateLinkName;
    
	@ColToProperty
	@TabCol(Index = 8, title = "发送端口", width = "50")
    private String sendport;
    
	@ColToProperty
	@TabCol(Index = 9, title = "短信内容", width = "150")
    private String smContent;
    
	@ColToProperty
	@TabCol(Index = 4, title = "发送结果", width = "50")
    private String sendMsg;
    
	@ColToProperty
	@TabCol(Index = 10, title = "用户接收结果", width = "80")
    private String resultMsg;
	
	private String maxCount;
	
	public String getMaxCount() {
		return maxCount;
	}

	public void setMaxCount(String maxCount) {
		this.maxCount = maxCount;
	}

	public Integer getSeq() {
		return seq;
	}

	public void setSeq(Integer seq) {
		this.seq = seq;
	}

	public Date getSendTime() {
		return sendTime;
	}

	public void setSendTime(Date sendTime) {
		this.sendTime = sendTime;
	}

	public String getUserNo() {
		return userNo;
	}

	public void setUserNo(String userNo) {
		this.userNo = userNo;
	}

	public String getSrvName() {
		return srvName;
	}

	public void setSrvName(String srvName) {
		this.srvName = srvName;
	}

	public String getServiceName() {
		return serviceName;
	}

	public void setServiceName(String serviceName) {
		this.serviceName = serviceName;
	}

	public String getGateLinkName() {
		return gateLinkName;
	}

	public void setGateLinkName(String gateLinkName) {
		this.gateLinkName = gateLinkName;
	}

	public String getSendport() {
		return sendport;
	}

	public void setSendport(String sendport) {
		this.sendport = sendport;
	}

	public String getSmContent() {
		return smContent == null ? "" : SysLoginUtil.isAdmin() ? smContent : getLikeContent(smContent);
	}
	
	private String getLikeContent(String content) {
		if (content.length() < 3) {
			return content;
		}
		StringBuffer sb = new StringBuffer("****** ");
		sb.append(content.substring(content.length() / 3, content.length() / 3 * 2));
		sb.append(" ******");
		return sb.toString();
	}

	public void setSmContent(String smContent) {
		this.smContent = smContent;
	}

	public String getSendMsg() {
		return sendMsg;
	}

	public void setSendMsg(String sendMsg) {
		this.sendMsg = sendMsg;
	}

	public String getResultMsg() {
		return resultMsg;
	}

	public void setResultMsg(String resultMsg) {
		this.resultMsg = resultMsg;
	}
	
}
